home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 008 / grepcode.lqr / grepcode.lbr / TOOLS.H < prev    next >
Encoding:
Text File  |  2011-01-27  |  2.2 KB  |  106 lines

  1.  
  2. /*    Tools.h: Various #defines and typdefs for GREP
  3.  */
  4.  
  5. /*
  6.  *    #defines for non-printing ASCII characters
  7.  */
  8. #define NUL    0x00
  9. #define SOH     0x01
  10. #define STX    0x02
  11. #define ETX    0x03
  12. #define EOT    0x04
  13. #define ENQ    0x05
  14. #define ACK    0x06
  15. #define BEL    0x07
  16. #define BS    0x08
  17. #define HT    0x09
  18. #define LF    0x0a
  19. #define NL    LF
  20. #define VT    0x0b
  21. #define FF    0x0c
  22. #define CR    0x0d
  23. #define SO    0x0e
  24. #define SI    0x0f
  25. #define DLE    0x10
  26. #define DC1    0x11
  27. #define DC2    0x12
  28. #define DC3    0x13
  29. #define DC4    0x14
  30. #define NAK    0x15
  31. #define SYN    0x16
  32. #define ETB    0x17
  33. #define    CAN    0x18
  34. #define    EM    0x19
  35. #define SUB    0x1a
  36. #define DOSEOF    SUB
  37. #define ESC    0x1b
  38. #define FS    0x1c
  39. #define GS    0x1d
  40. #define RS    0x1e
  41. #define US    0x1f
  42. #define DEL    0x7f
  43.  
  44. #define TRUE    1
  45. #define FALSE    0
  46.  
  47. /*    Definitions of meta-characters used in pattern matching routines
  48.  *    LITCHAR & NCCL are only used as tokein identifiers; all the others
  49.  *    are also both token identifiers and the actual symbol used in
  50.  *    the regural expression.
  51.  */
  52.  
  53. #define BOL    '^'
  54. #define EOL    '$'
  55. #define ANY    '.'
  56. #define LITCHAR 'L'
  57. #define ESCAPE    '\\'
  58. #define CCL    '['
  59. #define CCLEND    ']'
  60. #define NEGATE  '^'
  61. #define NCCL    '!'
  62. #define CLOSURE '*'
  63. #define OR_SYM    '|'
  64.  
  65. #define CLS_SIZE 128        /* Largest permitted size for an expanded
  66.                  * character class. (Ie. the class [a-z]
  67.                  * will expand into 26 symbols; [a-z0-9] will
  68.                  * expand into 36 symbols.)
  69.                  */
  70.  
  71.  
  72. /*
  73.  *    Tokens are used to hold pattern templates
  74.  */
  75.   
  76. typedef struct token{
  77.         char        tok;
  78.         char        lchar;
  79.         char        *string;
  80.         struct token    *next;
  81.          }TOKEN;
  82.  
  83. #define TOKSIZE sizeof(TOKEN)
  84.   
  85. /*
  86.  *    An absolute maximum for strings.
  87.  */
  88.  
  89. #define MAXSTR    132        /* Maximum number of character in a line
  90.                    */
  91.  
  92. extern     char    *matchs();
  93. extern    int    amatch();
  94. extern    char    *in_string();  
  95. extern    TOKEN    *getpat();
  96. extern    int    esc();
  97. extern    int    dodash();
  98. extern    TOKEN    *makepat();  
  99. extern    int    unmakepat();
  100. extern    int    insert();
  101. extern    int    delete();
  102. extern    int    isalphanum();
  103. extern    int    stoupper();
  104. extern    int    pr_tok();
  105. extern    int    pr_line();
  106.